from proxy.proxy_service import ProxyService
from model.proxy import Proxy, ProxyType
from model.error import ParkSpiderError, ParkSpiderErrorCode


class TunnelProxyService_KDL(ProxyService):
    def take(self, platformId: int) -> Proxy:
        try:
            meta = "http://y275.kdltps.com:15818"
            return Proxy(meta, ProxyType.Tunnel)
        except Exception as e:
            raise ParkSpiderError(ParkSpiderErrorCode.ProxyFail, repr(e))
